<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" isELIgnored="false"%>
<%@ include file="/WEB-INF/views/shared/taglib.jsp"%>
<table class="cntable table table-bordered dataTable table-stock">
	<thead>
		<tr>
			<th style="width:50px">序号</th>
			<th style="width:120px">货物名称</th>
			<th style="width:120px">编号</th>
			<th style="width:120px">货物库存</th>
			<th style="width:120px">备注</th>
			<th style="width:120px">规格</th>
			<th style="width:120px">规格库存</th>
		</tr>
	</thead>
	<tbody>
		<c:set var="sequence"  value="0"/>
		<c:forEach var="stock" items="${stocks}">
			
			<c:set var="trShow"  value="0"/>
			<c:set value="" var="trColor" />
			<tr data-id="${stock.stockId}">

				
				<c:forEach var="stockCollocation" items="${stock.stockCollocations}">
					<c:set var="sequence"  value="${sequence +1}"/>
					<c:set var="trShow"  value="${trShow +1}"/>
					<c:if test="${trShow == 1}" >
						<td>${sequence}</td>
						<td rowspan="${fn:length(stock.stockCollocations)}">${stock.cargo.cargoName}</td>
						<td rowspan="${fn:length(stock.stockCollocations)}">${stock.cargo.cargoNo}</td>
						<td rowspan="${fn:length(stock.stockCollocations)}">${stock.stockNum}</td>
						<td rowspan="${fn:length(stock.stockCollocations)}">${stock.comment}</td>
						<td>${stockCollocation.collocation.propertyNameOne}/${stockCollocation.collocation.propertyNameTwo}</td>
						<td>${stockCollocation.collocationNum}</td>
					</c:if>
					<c:if test="${trShow > 1}" >
						<tr data-id="${stock.stockId}">
							<td>${sequence}</td>
							<td>${stockCollocation.collocation.propertyNameOne}/${stockCollocation.collocation.propertyNameTwo}</td>
							<td>${stockCollocation.collocationNum}</td>
						</tr>
					</c:if>
				</c:forEach>
			</tr>
		</c:forEach>
	</tbody>
	<tfoot>
		<tr>
			<th class="pager-th absolute-pos">
				<%@ include file="/WEB-INF/views/shared/master/pager.jsp"%>
			</th>
		</tr>
	</tfoot>
</table>